<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let pi = Math.PI
        console.log(pi)
        //保留小数
        pi = pi.toFixed(4);
        console.log(pi);
      //向下取整
      console.log(Math.floor(0.78));  
      console.log(Math.floor(-5.78));  
      console.log(Math.floor(6.21));  
      //向上取整
      console.log(Math.ceil(0.78)); 
      console.log(Math.ceil(-5.78));  
      console.log(Math.ceil(6.78)); 
      //四舍五入
      console.log(Math.round(0.78));
      console.log(Math.round(-5.78));  
      console.log(Math.round(6.78));      
      //求平方根
      console.log(Math.sqrt(5));  
      //求x的y次幂
      console.log(Math.pow(2,3));  
    </script>
</body>
</html>